As computing technology continues to evolve, tasks performed by a given computer system is increasingly reliant upon, and often triggered by, environment and stimuli that are external to the computer system. For example, applications running on a computer system may respond to events initiated by another computer system (e.g., receipt of an e-mail, receipt of a push notification, etc.), or may respond to changes in the environment in which the computer system operates (e.g., a change in location as detected by a GPS sensor or a change in network state, a change in device orientation, a change in lighting, receipt of a user-initiated input, etc.).
An application could, for example, want to run a particular piece of code in response to the computer's network connectivity state changing, or in response to a Global Positioning System (GPS) receiver indicating the device has entered a particular geographic region. Thus, the occurrence of an external environmental event can cause one or more applications to activate to perform background activity in response to the trigger. For example, an application may activate to process changed GPS coordinates or changed network state, to process a push notification, etc. This allows flexibility for applications to react to a wide variety of real-world stimuli and provide useful experiences to users.
Computer systems cannot control when, or how often, external events occur. For example, an operating system cannot control how often a phone moves to a particular location, or how often a Wireless Fidelity (WiFi) signal cuts in and out. Thus, it is possible for environmental conditions to occur or change state so frequently that an undesired amount of background activity is caused by the environmental conditions. For example, code that applications have registered to run in response to a particular event could end up getting called far more frequently than the developer intended, resulting in excessive energy consumption by the computer system. This wastes energy, prematurely drains batteries on portable devices, and causes excessive heat generation.